//
//  OBaseLogic.m
//  soccer
//
//  Created by 上官千城 on 15/9/18.
//  Copyright (c) 2015年 上官千城. All rights reserved.
//

#import "OBaseLogic.h"
//#import <objc/runtime.h>
//#import <objc/message.h>
//#import <>


@implementation OBaseLogic


-(instancetype)initWithName:(NSString *)name recvObjc:(NSObject*)recvObjc callBack:(SEL)callBack
{
    self = [super init];
    if (self) {
        _url = [NSString stringWithFormat:@"http://%@:%d/OServer/%@", HOST, PORT,name];
        //_muDelegate = muDelegate;
        //_callBack = callBack;
        _recvObjc = recvObjc;
        _callBack = callBack;
        return self;
    }
    return nil;
}




-(void) send:(NSDictionary *)params
{
    
    ONet *onet = [[ONet alloc] initWithMethod:GET url:_url params:params reqData:nil];
    NSLog(@"_URL = %@ ",_url);
    [onet asynSend:self];
}


-(void)mu
{
    if (_recvObjc != nil && _callBack != nil) {
        //[objc performSelector:callBack withObject:self];
        
        [_recvObjc performSelector:_callBack withObject:self];
    }

    /*
    if (_muDelegate) {
        [_muDelegate muRun:self];
    }*/
    /*
    if (_callBack) {
        [self performSelector:_callBack withObject:self];
    }*/
     
}
 

@end
